import request from '@/utils/request'

export const getSetMealList = function(params) {
  return request({
    url: '/setmeal/page',
    method: 'get',
    params
  })
}

export const deleteSetMeal = function(ids) {
  return request({
    url: '/setmeal',
    method: 'delete',
    params: { ids }
  })
}

export const editSetMeal = function(params) {
  return request({
    url: '/setmeal',
    method: 'put',
    data: { ...params }
  })
}

export const addSetMeal = function(params) {
  return request({
    url: '/setmeal',
    method: 'post',
    data: { ...params }
  })
}

export const getSetMealById = function(id) {
  return request({
    url: `/setmeal/${id}`,
    method: 'get'
  })
}

export const batchStartOrStop = function(params) {
  return request({
    url: `/setmeal/status/${params.status}`,
    method: 'post',
    params: { ids: params.ids }
  })
}
